GroupNavigation::Application.routes.draw do

  devise_for :users, controllers: { omniauth_callbacks: "omniauth_callbacks" }

  root :to => 'home#main'

  scope 'search' do
    get '/(.:format)', :to => "search#user_by_email", :as => 'search_user_by_email'
  end

  resources :friends do
    put 'add' => 'friends#add', :as => "add"
  end

  resources :groups do
    put 'add' => "groups#add_member", :as => "add"
    get 'members' => "groups#members", :as => "members"
    get 'set_shared' => "groups#set_shared", :as => "set_shared"
    get 'unset_shared' => "groups#unset_shared", :as => "unset_shared"
    get 'after' => "groups#all_after"
    get 'send' => "messages#create"
  end

  get "edit" => "users#edit", :as => "edit_user"
  put "edit" => "users#update", :as => "update_user"

  post 'profile' => "users#update", :as => "update_profile"
  get 'profile' => "users#profile", :as => "current_profile"
  get 'set_location' => "users#set_location", :as => "set_location"



  get ':id' => "users#profile", :as => "profile"
  post 'auth' => "OmniauthCallbacks#mobile_auth"

end
